package com.cenwangkeji.resident.ui.activity;

import android.content.Intent;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.cenwangkeji.resident.R;
import com.cenwangkeji.resident.model.Constant;
import com.lws.basic.base.BaseActivity;
import com.lws.basic.utils.common.SharePreferenceUtils;

//启动页
public class SplashActivity extends BaseActivity {

    @Override
    public int setLayoutId() {
        return R.layout.activity_splash;
    }

    @Override
    public void initData() {
         super.initData();
         new Handler().postDelayed(new Runnable() {
             @Override
             public void run() {
                 boolean isLogin = SharePreferenceUtils.getBoolean(SplashActivity.this, Constant.is_login, false);
                if (isLogin){
                    startActivity(new Intent(SplashActivity.this,MainActivity.class));

                }else {
                    startActivity(new Intent(SplashActivity.this,LoginActivity.class));
                }
                finish();
             }
         }, 3000);

    }
}
